extends layout
include includes/post

block title
  title= post.title + ' - BYVoid'
  - if (!language)
    != css(post.language)

block content
  mixin post(post, false)
  - if (session.user)
    a(href='/admin/edit/' + post.guid)= label('Edit post')
  - if (!post.commentDisabled)
    #disqus_thread

block scripts
  #fb-root
  script.
    (function() {
      var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
      po.src = 'https://apis.google.com/js/platform.js';
      var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
    })();
    (function(d, s, id) {
      var js, fjs = d.getElementsByTagName(s)[0];
      if (d.getElementById(id)) return;
      js = d.createElement(s); js.id = id;
      js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&appId=153202208208599&version=v2.0";
      fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));
  - if (!post.commentDisabled)
    script.
      var disqus_shortname = '#{config.disqus.shortname}';
      var disqus_identifier = '#{post.guid}';
      var disqus_url = location.protocol + '//' + location.host + '/' + '#{post.id}';
      var disqus_title = '#{post.title}';
      var disqus_developer = #{config.disqus.developer};
      (function() {
      var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
      dsq.src = 'https://' + disqus_shortname + '.disqus.com/embed.js';
      (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
      })();
